package com.zzx.controller;

import com.zzx.entity.ApiResult;
import com.zzx.entity.TUserGroup;
import com.zzx.service.TUserGroupService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "员工分组 模块管理")
@RestController
@RequestMapping("/TEmployeeGroup")
public class TUserGroupController {

    @Resource
    private TUserGroupService tUserGroupService;

    @ApiOperation(value = "新增、编辑")
    @RequestMapping(value="/add",method = RequestMethod.POST)
    public ApiResult add(@RequestBody TUserGroup param) {
        tUserGroupService.add(param);
        return ApiResult.ok();
    }

    @ApiOperation(value = "删除")
    @RequestMapping(value="/deleteById",method = RequestMethod.POST)
    public ApiResult deleteById(@RequestBody TUserGroup param) {
        tUserGroupService.deleteById(param);
        return ApiResult.ok();
    }

    @ApiOperation(value = "列表查询")
    @RequestMapping(value="/selectBy",method = RequestMethod.POST)
    public ApiResult selectBy(@RequestBody TUserGroup param) {

        return ApiResult.ok(tUserGroupService.selectBy(param));
    } //注释1
}
